import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_base/index_page.dart';
import 'package:oktoast/oktoast.dart';

///
/// @DIR_PATH：lib
/// @TIME：2023/11/10 14:25
/// @AUTHOR：starr
/// 1.配置主题色，语言环境
/// 2.配置默认显示页面
class AppRootPage extends StatefulWidget {
  const AppRootPage({super.key});

  @override
  State<StatefulWidget> createState() => _AppRootPageState();
}

class _AppRootPageState extends State<AppRootPage> {
  @override
  Widget build(BuildContext context) {
    return OKToast(child: MaterialApp(
      title: 'Flutter 脚手架',
      //应用的主题
      theme: ThemeData(
        //主背景色
        primaryColor: Colors.blue,
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.lightBlueAccent),
        useMaterial3: true,
      ),
      //应用程序默认显示的页面
      home: const IndexPage(),
      //debug模式下不显示debug标签
      debugShowCheckedModeBanner: false,
      //国际化语言环境
      localizationsDelegates: [],
      //配置程序语言环境
      locale: const Locale('zh', 'CN'),
    ));
  }

  @override
  void dispose() {
    //执行一些注销订阅的操作
    super.dispose();
  }
}
